﻿using System;
using System.Collections.Generic;
using iESELibrary.ESEHandler;
using iESELibrary.DESCrypto.Vault;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTests
{
	[TestClass]
	public class UnitTest1
	{
		[TestMethod]
		public void TestMethod1()
		{
			using (ESEDatabase eseDb = new ESEDatabase(@"C:\Projects\Evaluation013\tstglobal\ntds.dit", @"C:\Projects\Evaluation013\tstglobal\SYSTEM"))
			{
				Queue<SortedList<string, string>> result = eseDb.RetrieveTranslatedAttributes("datatable",
					ESEDatabase.JetColumn.RID
					| ESEDatabase.JetColumn.sAMAccountName
					| ESEDatabase.JetColumn.userAccountControl
					| ESEDatabase.JetColumn.EncryptedNTHash
					| ESEDatabase.JetColumn.DecryptedNTHash
					,
					ESEDatabase.JetColumn.sAMAccountName
					| ESEDatabase.JetColumn.userAccountControl
					| ESEDatabase.JetColumn.EncryptedNTHash
					| ESEDatabase.JetColumn.DecryptedNTHash
					);
				while (result.Count > 0)
				{
					SortedList<string, string> row = result.Dequeue();
					Console.WriteLine(String.Format("{0}::{1})", row["sAMAccountName"], result.Dequeue()["DecryptedNTHash"]));
				}
			}
		}

		[TestMethod]
		public void TestMethod2()
		{
			using (SysKey vaultHives = new SysKey(@"C:\Projects\Evaluation013\tstglobal\SYSTEM"))
			{

			}
		}
	}
}
